import 'package:dio/dio.dart';

class Pair<F, S> {
  late F? first;
  late S? second;

  Pair(this.first, this.second);
}

class PairList<F, S> {
  List<Pair<F,S>> pairs = [];

  void addPair(Pair<F,S> pair) {
    pairs.add(pair);
  }

  Map<F, S> toMap() {
    Map<F, S> map = <F, S>{};
    for (var pair in pairs) {
      F? first = pair.first;
      S? second = pair.second;
      if (null != first  && null != second) {
        map[first] = second;
      }
    }
    return map;
  }
}

class NetRequest {
  late String path;
  late String? baseUrl;
  PairList<String,dynamic>? headers;
  PairList<String,dynamic>? parameters;
  CancelToken? cancelToken;

  NetRequest(
    this.path, {
    this.baseUrl,
    this.headers,
    this.parameters,
    this.cancelToken,
  });
}
